package com.yds.dubbo.zipkin.consumer;

import com.yds.dubbo.zipkin.api.GreetingService;
import org.apache.dubbo.rpc.RpcContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.concurrent.Future;

/**
 * @author liuhongzhen
 * @date 2023/3/24 15:52
 */
public class ConsumerBootstrap {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/client.xml");
        context.start();

        GreetingService greetingService = context.getBean("greetingService", GreetingService.class);

        greetingService.greeting("world");
        Future<?> future = RpcContext.getContext().getFuture();

        System.out.println(future.get());
    }
}
